package com.cloud.code.牛客网;

public class Test69 {

    public static void main(String[] args) {
        int i = Integer.parseInt("01");

        System.out.println(i);
    }

    public int compare (String version1, String version2) {

        String[] split = version1.split("\\.");
        String[] split2 = version1.split("\\.");

        int n = split.length > split2.length ? split.length : split2.length;

        int[] nums1 = new int[n];
        int[] nums2 = new int[n];

        for (int i = 0; i < split.length; i++) {
            nums1[i] = Integer.parseInt(split[i]);
        }

        for (int i = 0; i < split2.length; i++) {
            nums2[i] = Integer.parseInt(split2[i]);
        }

        for (int i = 0; i < n; i++) {
            if(nums1[i] > nums2[i]){
                return 0;
            }else if(nums1[i] < nums2[i]){
                return -1;
            }
        }

        return  0;

    }
}
